<template>
	<view>
		
		<view class="agreement-wrapper">
			<Parser :html="agreementInfo.agreement"></Parser>
		</view>
		
	</view>
</template>

<script>
	import Parser from "@/components/jyf-parser/jyf-parser";
	export default {
		components:{
			Parser
		},
		data() {
			return {
				agreementInfo: {}
			}
		},
		onReady() {
			this.getAgreement()
		},
		onLoad() {
			
		},
		methods: {
			
			// 协议接口
			async getAgreement(){
				let agreementRes,
					params = {
						method: "api/v2/system/agreement",
						tag: "login"
					}
				agreementRes = await this.$http(params);
				if(agreementRes.status){
					this.agreementInfo = agreementRes.data;
					uni.setNavigationBarTitle({
					    title: this.agreementInfo.agreement_title
					});
				}else{
					uni.showToast({
						title: agreementRes.msg,
						icon: 'none'
					})
				}
			}
			
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #fff;
	}
	.agreement-wrapper{
		color: #666;
		padding: 20rpx 24rpx;
		font-size: 24rpx;
	}
	.agreement-wrapper *{
		max-width: 100%;
	}
</style>
